<?php

class App_WebService_Caller {

  /**
   * Invoked method from WebService
   * @var string
   */
  static public $methodName;

  public function __call($methodName, $arg = null) {
    $arg = reset($arg);
    self::$methodName = $methodName;
    if ($arg->app === null)
      throw new App_Exception_Core(5001);
    App_WebService_ValidateApp::validate($arg->app, $methodName);

    $ws = new App_WebService_Methods();
    $response = $ws->$methodName($arg);
    return $response;
  }

}